package com.logic.saas.util;
import org.apache.commons.lang.StringUtils;


public class SysUtil{
	
	public static String trim(String str) {
		if (StringUtils.isNotBlank(str))
			return str.trim();
		else
			return "";
	}

	/**
	 * 
	 * @param originalStr
	 * @param cutCount
	 * @return
	 */
	public static String cutoffString(String originalStr, int cutCount) {
		if (StringUtils.isBlank(originalStr) || cutCount <= 0)
			return "";
		int length = originalStr.length();
		if (cutCount >= length)
			return originalStr;

		String handledStr = originalStr;
		handledStr = handledStr.substring(0, cutCount) + " ...";
		return handledStr;
	}
}